# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python2-tftpy
_pkgname=tftpy
pkgver=0.8.0
pkgrel=1
pkgdesc='Python TFTP library.'
url='https://pypi.org/project/tftpy/#files'
arch=('any')
license=('MIT')
depends=('python2')
makedepends=('python2-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('7c257ae847311698da7b31290bce81dba575ec8c79c1f914aa72277a5bda0d1e979ed27c73cce8746c92e785060e63881463012b55584ee6868e36a6d290c177')

build() {
  cd "$_pkgname-$pkgver"

  python2 setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  for i in "$pkgdir/usr/bin/"*; do
    mv $i "${i}2"
  done
}

